package service.Impl;

import dao.DoctorDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Doctor;
import service.DoctorService;

import java.util.List;

@Service
public class DoctorServiceImpl implements DoctorService {

    @Autowired
    private DoctorDao doctorDao;

    @Override
    public int insertDoctor(Doctor doctor) {
        return doctorDao.insertDoctor(doctor);
    }

    @Override
    public int deleteDoctorById(String docId) {
        return doctorDao.deleteDoctorById(docId);
    }

    @Override
    public int updateDoctor(Doctor doctor) {
        return doctorDao.updateDoctor(doctor);
    }

    @Override
    public Doctor selectDoctorById(String docId) {
        return doctorDao.selectDoctorById(docId);
    }

    @Override
    public List<Doctor> selectAllDoctors() {
        return doctorDao.selectAllDoctors();
    }
    @Override
    public List<Doctor> searchByName(String docName) {
        return doctorDao.searchByName("%" + docName + "%"); // 模糊查询
    }
}